// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// ajax loading message functions
function showNotify( str ) { 
  var elem = document.getElementById('rc_notify');
  elem.style.display = 'block'; 
  elem.style.visibility = 'visible';

  if ( elem.currentStyle && 
       elem.currentStyle.position == 'absolute' ) 
  {
    elem.style.top = getScrollTop();
    window.onscroll = scrollHandler;
  }

  elem.innerHTML = str;
}

function hideNotify() {
  var elem = document.getElementById('rc_notify');
  elem.style.display = 'none';
  elem.style.visibility = 'hidden';
  window.onscroll = null;
}

function showLoadingNotify() {
	showNotify( " <img src='/images/spinner.gif'/> Loading..." )
}

Ajax.Responders.register({
  onCreate: function() {
    showLoadingNotify();
  },
  onComplete: function() {
    hideNotify();
  }
});